package com.cincc.cinccimdemo.model;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;

import com.cincc.im.model.enums.ImSendType;

public class ConversationInfo implements Parcelable {
    public ImSendType imSendType;
    public String targetId;
    public String targetName;
    public String draft;

    public ConversationInfo() {

    }

    public ConversationInfo(Parcel in) {
        targetId = in.readString();
        targetName = in.readString();
        draft = in.readString();
        imSendType = ImSendType.fromValue(in.readInt());
    }

    public static final Creator<ConversationInfo> CREATOR = new Creator<ConversationInfo>() {
        @Override
        public ConversationInfo createFromParcel(Parcel in) {
            return new ConversationInfo(in);
        }

        @Override
        public ConversationInfo[] newArray(int size) {
            return new ConversationInfo[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        dest.writeString(targetId);
        dest.writeString(targetName);
        dest.writeString(draft);
        dest.writeInt(imSendType.value());
    }
}
